package cn.changeforyou.analyzer.astDiff;

import gumtree.spoon.AstComparator;
import gumtree.spoon.diff.Diff;
import org.junit.jupiter.api.Test;

import java.io.File;

public class Demo {

    @Test
    public void test() throws Exception {
        AstComparator astComparator = new AstComparator();
        Diff diff1 = astComparator.compare(new File("D:\\code\\analyzer\\analyzer\\src\\main\\resources\\srcFiles\\t1\\HelloWorld.java"),
            new File("D:\\code\\analyzer\\analyzer\\src\\main\\resources\\srcFiles\\t2\\HelloWorld.java"));
        System.out.println(diff1);

        Diff diff2 = astComparator.compare(new File("D:\\code\\analyzer\\analyzer\\src\\main\\resources\\srcFiles\\t1\\A.java"),
            new File("D:\\code\\analyzer\\analyzer\\src\\main\\resources\\srcFiles\\t2\\A.java"));
        System.out.println(diff2);

		Diff diff3 = astComparator.compare(new File("D:\\code\\analyzer\\analyzer\\src\\main\\resources\\srcFiles\\t1\\B.java"),
			new File("D:\\code\\analyzer\\analyzer\\src\\main\\resources\\srcFiles\\t2\\B.java"));
		System.out.println(diff3);
		
    }
}
